-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Use more use statements #250
Conversation
Quality Gate passedIssues Measures |
|
||
if (!$config->getOptionalBoolean('enable.saml20-idp', false)) { | ||
throw new \SimpleSAML\Error\Error('NOACCESS'); | ||
throw new Error\Error('NOACCESS'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Perhaps a use ...\Error\Error as SimpleSAML_Error?
@@ -145,7 +150,7 @@ | |||
); | |||
|
|||
if (!$idpmeta->hasValue('OrganizationURL')) { | |||
throw new \SimpleSAML\Error\Exception('If OrganizationName is set, OrganizationURL must also be set.'); | |||
throw new Error\Exception('If OrganizationName is set, OrganizationURL must also be set.'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As above, but use ... as SimpleSAML_Exception?
@@ -224,5 +229,5 @@ | |||
exit(0); | |||
} | |||
} catch (Exception $exception) { | |||
throw new \SimpleSAML\Error\Error('METADATA', $exception); | |||
throw new Error\Error('METADATA', $exception); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I understand the less 'use' statements, but SimpleSAML_Error would be good in my opinion.
@@ -124,7 +127,7 @@ public function process(array &$state): void | |||
$samlIDP = $state[self::IDP_KEY]; | |||
|
|||
if (empty($state[self::SP_NAMEID_ATTR])) { | |||
\SimpleSAML\Logger::warning( | |||
Logger::warning( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"use ... as SS_Logger" would help distinguish the Logger, given the multitude of Logger's out there.
|
||
$idpEntry = $idpEntries[$samlIDP]; | ||
|
||
// The IDP metadata must have an IDPNamespace entry | ||
if (!isset($idpEntry[self::IDP_CODE_KEY])) { | ||
throw new \SimpleSAML\Error\Exception(self::ERROR_PREFIX . "Missing required metadata entry: " . | ||
throw new Error\Exception(self::ERROR_PREFIX . "Missing required metadata entry: " . |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Already commented about the Error\something above multiple times. Not going to comment on each one.
@@ -17,7 +20,7 @@ class TrackIdps extends \SimpleSAML\Auth\ProcessingFilter | |||
public function process(array &$state): void | |||
{ | |||
// get the authenticating Idp and add it to the list of previous ones | |||
$session = \SimpleSAML\Session::getSessionFromRequest(); | |||
$session = Session::getSessionFromRequest(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thinking about Session... perhaps a "use ... as SS_Session" might be useful, given there is a Yii session object.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
My comments are suggestions, not necessarily forced request for changes. This is already a nice improvement.
@mtompset thanks for the alias suggestions. They might be a next step if/when things get messy or confusing. |
Fixed